﻿using Microsoft.AspNetCore.Builder;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApplication.Middlewares
{
    /// <summary>
    /// 中间件扩展
    /// </summary>
    public static class MiddlewareExtensions
    {
        /// <summary>
        /// 启用性能监控
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static IApplicationBuilder UseResponseTimeMonitor(this IApplicationBuilder builder, ILogger logger)
        {
            return builder.UseMiddleware<ResponseTimeMiddleware>(logger);
        }
    }
}
